Unmap vcpu_info mapping in arch_domain_destroy.
authorJeremy Fitzhardinge <jeremy@xensource.com>
Thu, 24 May 2007 12:25:05 +0000 (13:25 +0100)
committerJeremy Fitzhardinge <jeremy@xensource.com>
Thu, 24 May 2007 12:25:05 +0000 (13:25 +0100)
We don't need to touch it in arch_vcpu_reset() because that's only used
to recover from a failed suspend, and the correct behaviour there is to
leave the mapping as-is.

xen/arch/x86/domain.c

index e413b0249c4c34fbebd60d8c98e30e67d7879bae..bf6ad0c5e382812b53b5513c47667ae3dc046578 100644 (file)
@@ -489,6 +489,9 @@ void arch_domain_destroy(struct domain *d)
 {
     struct vcpu *v;
 
+    for_each_vcpu( d, v )
+        unmap_vcpu_info(v);
+
     if ( is_hvm_domain(d) )
     {
         for_each_vcpu ( d, v )
@@ -731,7 +734,6 @@ int arch_set_info_guest(
 
 int arch_vcpu_reset(struct vcpu *v)
 {
-    unmap_vcpu_info(v);
     destroy_gdt(v);
     vcpu_destroy_pagetables(v);
     return 0;
@@ -739,8 +741,8 @@ int arch_vcpu_reset(struct vcpu *v)
 
 /* 
  * Unmap the vcpu info page if the guest decided to place it somewhere
- * else.  This is only used from arch_vcpu_reset, so there's no need
- * to do anything clever.
+ * else.  This is only used from arch_domain_destroy, so there's no
+ * need to do anything clever.
  */
 static void
 unmap_vcpu_info(struct vcpu *v)